<template>
  <div class="detailBom" @click.stop="aotuTab = false">
    <el-tabs v-model="activeName" type="border-card">
      <el-tab-pane :label="$t('market.bomInfo')" name="addBom">
        <div class="tool">
          <jc-button
            :btn-arr="['reload', 'remove', 'pass', 'sub', 'save']"
            :disab-arr="[isDisabled && 'save', 'nosub']"
            @refresh="setForm"
            @save="handleSubmit"
            @submit="handleSubmit(1)"
            @audit="bomAdopt()"
            @noAudit="bomDeAudit()"
            @del="delBom"
          />
          <el-button
            size="mini"
            type="primary"
            style="margin-left: 10px;"
            @click="handleCopyBom"
          >
            {{ $t('market.copyBom') }}<!--复制bom-->
          </el-button>
          <el-button size="mini" type="warning" @click="handleReverse">
            {{ $t('market.reverseBom') }}<!--反查bom-->
          </el-button>
          <div class="summation">
            {{ $t('market.materialcost') }}:<!--物料成本-->
            <span class="color-text">
              {{
                Math.round((materialScience + Number.EPSILON) * 100) /
                  100
              }}元
            </span>
            {{ $t('market.documentstatus') }}:<!--审核状态-->
            <el-tag :type="prodValue.stateColor" size="mini">
              {{ prodValue.FDOCUMENTSTATUS }}
            </el-tag>
          </div>
        </div>
        <div class="form-layout">
          <el-upload
            class="avatar-uploader"
            disabled
            action="#"
            :show-file-list="false"
          >
            <el-image
              v-if="prodValue.FIMG"
              :src="prodValue.FIMG"
              class="avatar"
              :preview-src-list="[prodValue.FIMG]"
            />
          </el-upload>
          <!--表头-->
          <jc-form
            :option-value="prodValue"
            :options="prodOptions"
            @handleMagnifier="handleMagnifier"
            @openNumber="isMateriaHeader=true"
            @mater="sonJumpMateriel(prodValue.FNUMBER)"
          />
        </div>
        <div style="margin-bottom: 5px;">
          <el-button
            size="mini"
            style="margin-bottom: -5px;"
            :disabled="isDisabled"
            @click="newHang"
          >
            {{ $t('btn.newHang') }}<!--新增行-->
          </el-button>
          <el-button
            size="mini"
            style="margin-bottom: 5px;"
            :disabled="isDisabled"
            @click="delHang"
          >
            {{ $t('btn.delHang') }}<!--删除行-->
          </el-button>
        </div>
        <div>
          <jc-table
            :table-data="sonTableData"
            :table-header="sonTableHeader"
            class="materiel-table"
            :table-height="tableHeight"
            @rowClick="rowClick"
          >
            <el-table-column
              :label="$t('shop.numIndex')"
              prop="FSEQ"
              align="center"
              width="80px"
            >
              <template slot-scope="scope">
                <el-input-number
                  v-model="scope.row.FSEQ"
                  :disabled="isDisabled"
                  :min="0"
                  size="mini"
                />
              </template>
            </el-table-column>
            <el-table-column
              :label="$t('market.materImg')"
              prop="FIMG"
              align="center"
              width="80px"
            >
              <template slot-scope="scope">
                <el-image
                  :src="$img + scope.row.FIMG"
                  class="materielImg"
                  :preview-src-list="[$img + scope.row.FIMG]"
                />
              </template>
            </el-table-column>
            <el-table-column
              :label="$t('market.fmodel')"
              prop="FMODEL"
              align="center"
              width="100px"
              :show-overflow-tooltip="true"
            />
            <el-table-column
              :label="$t('market.fmaterial')"
              prop="FNUMBER"
              align="center"
              width="170px"
            >
              <template slot-scope="scope">
                <el-input
                  v-model.trim="scope.row.FNUMBER"
                  size="mini"
                  :disabled="isDisabled"
                  @input="getAtuo(scope.$index, scope.row.FNUMBER)"
                >
                  <i
                    slot="prefix"
                    class="iconfont icon-jin-rud-ao-bo"
                    @click="sonJumpMateriel(scope.row.FNUMBER)"
                  />
                  <i
                    slot="suffix"
                    class="el-input__icon el-icon-search"
                    @click="handleAddBom(scope.$index)"
                  />
                </el-input>
                <div
                  v-if="aotuTab && tableIndex === scope.$index"
                  :class="tableIndex < 7 ? 'tabPosit' : 'tabPosit1'"
                >
                  <number-code
                    :bom-code="bomCode"
                    :fnumber="fnumber1"
                    @material="materialData"
                  />
                </div>
              </template>
            </el-table-column>
            <el-table-column
              :label="$t('shop.fname2')"
              prop="fname"
              align="center"
              min-width="130px"
              :show-overflow-tooltip="true"
            />
            <el-table-column
              :label="$t('market.fdescripTion')"
              prop="FDESCRIPTION"
              align="center"
              min-width="130px"
              :show-overflow-tooltip="true"
            />
            <el-table-column
              :label="$t('shop.fspecificaTion')"
              prop="FSPECIFICATION"
              align="center"
              min-width="100px"
              :show-overflow-tooltip="true"
            />
            <el-table-column
              :label="$t('market.ferpcls')"
              prop="ferpcls"
              align="center"
              width="80px"
            />
            <el-table-column
              :label="$t('market.stockQty')"
              prop="sumQty"
              align="center"
              width="80px"
            />
            <el-table-column
              :label="$t('market.dosage')"
              prop="FDOSAGE"
              align="center"
              width="80px"
            >
              <template slot-scope="scope">
                <el-input-number
                  v-model="scope.row.FDOSAGE"
                  :disabled="isDisabled"
                  :precision="4"
                  :step="0.0001"
                  :min="0.0"
                  size="mini"
                  @change="amountHandel(scope.$index)"
                />
              </template>
            </el-table-column>
            <el-table-column
              :label="$t('market.funit')"
              prop="FUNITNAME"
              align="center"
              width="60px"
            />
            <el-table-column
              :label="$t('market.fprice')"
              prop="FPRICE"
              align="center"
              width="80px"
            >
              <template slot-scope="scope">
                <el-input-number
                  v-model="scope.row.FPRICE"
                  :disabled="isDisabled"
                  :precision="4"
                  :step="0.0001"
                  :min="0.0"
                  size="mini"
                  @change="amountHandel(scope.$index)"
                />
              </template>
            </el-table-column>
            <el-table-column
              :label="$t('market.billamount')"
              prop="famount"
              align="center"
              width="60px"
            />
            <el-table-column :label="$t('market.issueType')" align="center">
              <template slot-scope="scope">
                <el-select
                  v-model="scope.row.FISSUETYPE"
                  size="mini"
                  disabled
                >
                  <el-option
                    v-for="item in issueMaterialsOptions"
                    :key="item.FVALUE"
                    :label="item.FISSUETYPE"
                    :value="item.FVALUE"
                  />
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              :label="$t('market.isskip')"
              prop="FISSKIP"
              align="center"
              width="60px"
            >
              <template slot-scope="scope">
                <el-checkbox v-model="scope.row.FISSKIP" :disabled="isDisabled" />
              </template>
            </el-table-column>
            <el-table-column
              :label="$t('market.priceSource')"
              prop="PRICESOURCE"
              align="center"
              width="90px"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.PRICESOURCE===0">{{ $t('market.manually') }}<!--手动录入--></span>
                <span v-else-if="scope.row.PRICESOURCE===1">{{ $t('menu.purchasePriceTao') }}<!--采购价目表--></span>
              </template>
            </el-table-column>
            <el-table-column
              :label="$t('market.priceValidity')"
              prop="PRICELISTVALIDDATE"
              align="center"
              width="90px"
            />
          </jc-table>
        </div>
      </el-tab-pane>
      <el-tab-pane :label="$t('market.other')" name="other">
        <jc-form :option-value="otherUrlObject" :options="otherOptions" />
        <div>
          <jc-table
            :table-header="logTableHeader"
            :table-data="otherLogTableData"
            serial
            table-height="65.96vh"
          />
        </div>
        <jc-pagination
          v-show="otherPagination.total > 0"
          :total="otherPagination.total"
          :page.sync="otherPagination.pageNum"
          :limit.sync="otherPagination.pageSize"
          @pagination="handleOther"
        />
      </el-tab-pane>
    </el-tabs>
    <jc-reverse ref="mychild" :mat-id="matId" />
    <!--  表格物料弹窗-->
    <material v-if="isMateria" @material="materialData" />
    <!--  表头父项物料弹窗  -->
    <materDia v-if="isMateriaHeader" @mater="materHeader" />
  </div>
</template>

<script>
import jcForm from '@/components/Form'
import jcReverse from '@/views/engineering/treeBom/reverse'
import { queryLog } from '@/api/engineering/deitalBom'
import { queryBomchildList } from '@/api/engineering/deitalBom'
import {
  queryMaterialSon,
  queryViewItem,
  updateBomTreeReview,
  updateConfirmBomTree,
  updateTempSave
} from '@/api/engineering/createBom'
import { upDateBom } from '@/api/engineering/editBom'
import { toDocument } from '@/components/ToMxamineState'
import { deleteBom } from '@/api/engineering/bomList'
import jcButton from '@/components/Button'
export default {
  name: 'DetailBom',
  components: {
    jcButton,
    jcForm,
    jcReverse,
    materDia: () => import('@/views/engineering/detailTree/materDia'),
    material: () => import('@/views/market/marketManage/createMarkerOrder/components/material'),
    numberCode: () => import('@/components/NumberCode')
  },
  props: {
    fnumbers: {
      type: String,
      required: true,
      default: ''
    }
  },
  data() {
    return {
      bomCode: '0',
      isMateria: false,
      isMateriaHeader: false,
      tableHeight: '46vh',
      activeName: 'addBom', // 默认主产品 product Other
      // 子表数据
      sonTableData: [],
      sonTableHeader: [],
      matId: 0, // 传给反查bom的物料id
      prodValue: {}, // 产品表单值
      prodOptions: {}, // 产品表单元素
      otherLogTableData: [], // 日志数据
      otherPagination: {
        pageNum: 1,
        pageSize: 10,
        total: 0
      },
      FMATERIALCOST: '', // 物料成本
      logTableHeader: [
        { label: this.$t('market.operator'), prop: 'fname' },
        { label: this.$t('market.pattern'), prop: 'fattributes' },
        { label: this.$t('market.fdate'), prop: 'createDate' },
        { label: this.$t('market.deaprt'), prop: 'fdeaprt' },
        { label: this.$t('market.fmaterial'), prop: 'fbillNo' },
        { label: this.$t('market.ipSite'), prop: 'fip' },
        { label: this.$t('market.describe'), prop: 'fdescribe' }
      ],
      tableIndex: 0,
      issueMaterialsOptions: [],
      isDisabled: false,
      aotuTab: false,
      fnumber1: '',
      otherUrlObject: {}, // 其它审核人
      otherOptions: {},
      FID: '', // 父类物料ID
      srcList: [] // 预览图片数据
    }
  },
  computed: {
    Summation() {
      const num = this.sonTableData.map(item => {
        const { FPRICE, FDOSAGE } = item
        item.money = FPRICE * FDOSAGE
        return item.money
      })
      const total = num.reduce((total, num) => {
        return total + num
      }, 0)
      return parseInt(total * 100) / 100
    },
    materialScience() {
      return this.Summation + Number(this.prodValue.FLABORCOST)
    }
  },
  watch: {
    fnumbers: {
      handler(val) {
        this.fnumber1 = val
        this.setForm(val)
        this.handleOther()
      },
      immediate: true
    }
  },
  created() {
    this.getIssuing()
    this.tableHeight = window.innerWidth > 1440 ? 'calc(100vh - 380px)' : '57vh'
  },
  methods: {
    sonJumpMateriel(ev) {
      this.$emit('pushMater', ev)
    },
    // 输入物料编码
    getAtuo(index, fnumber) {
      this.tableIndex = index
      this.aotuTab = true
      var vm = this
      clearTimeout(vm.timer) // 清除未执行的代码，重置回初始化状态
      vm.timer = setTimeout(() => {
        this.fnumber1 = fnumber
      }, 600)
    },
    // 保存
    async handleSubmit(ev) {
      const fTreeEntity = this.sonTableData.map(item => {
        const {
          FUNITNAME,
          FISSUETYPE,
          FMATERIALID,
          FISSKIP,
          FMATERIALTYPE,
          FDOSAGE,
          FPRICE,
          FENTRYID,
          FSEQ
        } = item
        return {
          FUNITNAME,
          FISSUETYPE,
          FISSKIP: Number(FISSKIP),
          FMATERIALID,
          FMATERIALTYPE,
          FDOSAGE,
          FPRICE,
          FENTRYID,
          FSEQ
        }
      })
      const { FMATERIALID, FID, workingHours, artificialSum } = this.prodValue
      const DATA = {
        flg: false,
        FLABORCOST: this.prodValue.FLABORCOST,
        FMATERIALID,
        fcraftId: this.prodValue.fcraftId,
        FID,
        fTreeEntity,
        workingHours, artificialSum
      }
      // if (DATA.FLABORCOST === 0) {
      //   this.$message.warning('人工成本不能小于0,请重新输入!')
      //   return
      // }
      for (const item of DATA.fTreeEntity) {
        const ARRAY = Object.values(item)
        const RES = ARRAY.includes('' || undefined) || DATA.FMATERIALID === 0
        if (RES === true || RES.FDOSAGE === 0) {
          this.$message.warning('表格数据不能为空或用量不能为0!')
          return
        }
      }
      const { code, message } = await upDateBom(DATA)
      if (code === 0) {
        ev === 1 ? this.bomSubmit() : this.setForm()
        this.$emit('reloadBom')
        this.$message({ showClose: true, message: message, type: 'success' })
      } else {
        this.$confirm(message, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        })
      }
    },
    // 金额
    amountHandel(index) {
      const item = this.sonTableData[index]
      item.famount = (item.FPRICE * item.FDOSAGE).toFixed(2)
    },
    /* 复制bom */
    handleCopyBom() {
      this.$emit('copy', this.prodValue.FNUMBER)
    },
    // 反查bom
    handleReverse() {
      this.$refs.mychild.getBomFatherList()
    },
    // 父项物料
    materHeader(item) {
      if (item.FMATERIALID) {
        this.setForm(item.FNUMBER)
      }
      this.isMateriaHeader = false
    },
    // 打开工艺列表
    handleMagnifier(val) {
      if (val === 'fcraftName') {
        this.craftVis = true
      }
    },
    // 发料数据
    async getIssuing() {
      const { data: res } = await queryViewItem({
        viewName: 'SX_V_UNIT_ISSUETYPE'
      })
      this.issueMaterialsOptions = res.list.map(item => {
        return { FISSUETYPE: item.fname, FVALUE: item.fid }
      })
    },
    // 删除BOM
    delBom() {
      this.$confirm('该操作将永久删除BOM，确定要删除么？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        const api = deleteBom
        const DATA = { Numbers: [this.prodValue.FNUMBER] }
        api(DATA).then(res => {
          if (res.code !== 0) {
            this.$confirm(res.message, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'error'
            })
            return
          }
          this.$emit('delBom')
          this.innerHTM = ''
          res.data.forEach(res => {
            this.innerHTM += '<div>' + res + '</div>'
          })
          this.$notify.warning({
            title: '提示',
            message: this.innerHTM,
            duration: 3000, offset: 50,
            dangerouslyUseHTMLString: true
          })
        })
      })
    },
    // 获取其它
    async handleOther() {
      const fbillNo = `BOM:${this.fnumbers}`
      const { data: res, code, message } = await queryLog({
        ...this.otherPagination,
        fbillNo
      })
      if (code !== 0) {
        this.$message.warning(message)
        return
      }
      const { array, total } = res
      this.otherLogTableData = array
      this.otherPagination.total = total
    },
    // Form表单
    async setForm(ev) {
      const fnumber = ev || this.fnumbers
      if (!fnumber) return
      const { data: RES, code, message } = await queryBomchildList({ fnumber })
      if (code === 1) {
        this.$confirm(message, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'error'
        })
        return
      }
      const {
        FID,
        FMATERIALCOST,
        FMATERIALID,
        child,
        fcreator, // 创建人
        fcreatedate, // 创建时间
        fmodifier, // 修改人
        fmodifydate, // 修改时间
        fapprover, // 审核人
        fapprovedate, // 审核时间
        fforbidder, // 禁用人
        fforbiddate // 禁用时间
      } = RES
      this.otherUrlObject = {
        fcreator,
        fcreatedate,
        fmodifier,
        fmodifydate,
        fapprover,
        fapprovedate,
        fforbidder,
        fforbiddate
      }
      this.matId = FMATERIALID
      this.FID = FID
      this.FMATERIALCOST = FMATERIALCOST
      this.sonTableData = child.map(item => {
        const { FISSKIP, FIMG } = item
        this.srcList.push(FIMG)
        const value = Number(FISSKIP)
        item.FISSKIP = Boolean(value)
        return item
      })
      // 物料form
      this.prodValue = toDocument(RES)
      this.isDisabled = this.prodValue.FDOCUMENTSTATUS === this.$t('market.state1') || this.prodValue.FDOCUMENTSTATUS === this.$t('market.state2')
      this.prodValue.FMATERIALCOST = this.Summation
      this.otherOptions = {
        fcreator: {
          label: this.$t('market.creator'),
          disabled: 'disabled'
        },
        fcreatedate: {
          label: this.$t('market.createDate'),
          disabled: 'disabled'
        },
        fmodifier: {
          label: this.$t('market.modifier'),
          disabled: 'disabled'
        },
        fmodifydate: {
          label: this.$t('market.modifyDate'),
          disabled: 'disabled'
        },
        fapprover: {
          label: this.$t('market.approver'),
          disabled: 'disabled'
        },
        fapprovedate: {
          label: this.$t('market.approveDate'),
          disabled: 'disabled'
        },
        fforbidder: {
          label: this.$t('market.forbider'),
          disabled: 'disabled'
        },
        fforbiddate: {
          label: this.$t('market.forbidDate'),
          disabled: 'disabled'
        }
      }
      this.prodOptions = {
        FNUMBER: {
          label: this.$t('market.fmaterial'),
          labelWidth: '120px',
          span: 6,
          type: 'inptBer',
          disabled: true
        },
        FMODEL: {
          label: this.$t('market.fmodel'),
          span: 18,
          disabled: true,
          labelWidth: '120px'
        },
        fname: {
          label: this.$t('shop.fname2'),
          labelWidth: '120px',
          disabled: true
        },
        FDESCRIPTION: {
          label: this.$t('market.fdescripTion'),
          labelWidth: '120px',
          type: 'input_textarea',
          span: 16,
          disabled: true
        },
        FMATERIALCOST: {
          // type: 'bom',
          labelWidth: '120px',
          label: this.$t('market.matercost'),
          disabled: true
        },
        FSPECIFICATION: {
          label: this.$t('shop.fspecificaTion'),
          labelWidth: '120px',
          disabled: true
        },
        FUNIT: {
          label: this.$t('market.materunit'),
          labelWidth: '120px',
          disabled: true
        },
        FWEIGHTUNIT: {
          label: this.$t('market.weightUnit'),
          labelWidth: '120px',
          disabled: true
        },
        FLABORCOST: {
          // type: 'bom',
          labelWidth: '120px',
          label: this.$t('market.planLabor'),
          disabled: this.isDisabled
        },
        fcraftName: {
          label: this.$t('market.craft'),
          labelWidth: '120px',
          disabled: this.isDisabled
        },
        FGROSSWEIGHT: {
          label: this.$t('market.grossweight'),
          labelWidth: '120px',
          disabled: true
        },
        FNETWEIGHT: {
          label: this.$t('market.netweight'),
          labelWidth: '120px',
          disabled: true
        },
        actualcost: {
          label: this.$t('market.actualcost'),
          type: 'number',
          disabled: true,
          labelWidth: '120px'
        },
        ferpcls: {
          label: this.$t('market.ferpcls'),
          disabled: true,
          labelWidth: '120px'
        },
        workingHours: {
          label: this.$t('market.workingHours'),
          type: 'number',
          labelWidth: '120px',
          disabled: this.isDisabled
        },
        artificialSum: {
          label: this.$t('market.artificialSum'),
          type: 'number',
          labelWidth: '120px',
          disabled: this.isDisabled
        }
      }
    },
    /* bom审核通过 */
    async bomAdopt() {
      const { code, message } = await updateBomTreeReview({ fid: this.prodValue.FID })
      if (code !== 0) {
        this.$confirm(message, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'error'
        })
        return
      }
      this.setForm()
      this.$message({ showClose: true, message, type: 'success' })
    },
    /* bom反审核 */
    async bomDeAudit() {
      const { code, message } = await updateTempSave({
        matId: this.matId
      })
      if (code !== 0) {
        this.$confirm(message, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'error'
        })
        return
      }
      this.setForm()
      this.$message({ showClose: true, message, type: 'success' })
    },
    /* bom提交 */
    async bomSubmit() {
      const { code, message } = await updateConfirmBomTree({
        FMATERIALID: this.matId
      })
      if (code !== 0) {
        this.$confirm(message, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'error'
        })
        return
      }
      this.setForm()
      this.$message({ showClose: true, message, type: 'success' })
    },
    // 打开父物料编码
    handleMateriel() {},
    // 新增子bom
    async handleAddBom(index) {
      this.tableIndex = index
      this.isMateria = true
    },
    // 双击子bom
    async materialData(item) {
      if (!item.fmaterialId) {
        this.isMateria = false
        return
      }
      const data = {
        fmateriAalId: item.fmaterialId,
        fnumber: item.fnumber
      }
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      const { data: res, code, message } = await queryMaterialSon(data)
      if (code !== 0) {
        this.$confirm(message, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'error'
        })
        return
      }
      loading.close()
      const {
        fname,
        FUNITNAME,
        FDOSAGE,
        FMATERIALID,
        FNUMBER,
        FPRICE,
        FDESCRIPTION,
        FISSKIP,
        FSPECIFICATION,
        FISSUETYPEID
      } = res
      const obj = {
        fname,
        FUNITNAME,
        FDOSAGE,
        FMATERIALID,
        FNUMBER,
        FPRICE,
        FDESCRIPTION,
        FISSKIP: FISSKIP === 1,
        FSPECIFICATION,
        FISSUETYPEID,
        FENTRYID: 0
      }
      for (const key in obj) {
        this.sonTableData[this.tableIndex][key] = obj[key]
      }
      this.isMateria = false
    },
    // 新增行
    newHang() {
      this.sonTableData.push({
        FSEQ: 0,
        FIMG: '',
        FENTRYID: 0,
        FMATERIALID: this.serial++, // 唯一的id
        FNUMBER: '', // 物料编码
        FDESCRIPTION: '', // 物料描述
        FISSKIP: false, // 是否跳层
        FSPECIFICATION: '', // 物料规格
        FUNITNAME: '', // 单位
        FMATERIALTYPE: '1', // 选中值
        FISSUETYPE: 42, // 选中值
        FPRICE: 0, // 单价
        FDOSAGE: 0, // 用量
        money: 0 // 金额
      })
    },
    // 单击行
    rowClick(row) {
      this.indexSelf = row.index
    },
    // 删除行
    delHang() {
      this.sonTableData.splice(this.indexSelf, 1)
    }
  }
}
</script>

<style scoped lang="scss">
.detailBom {
  min-width: 1550px;
}
.el-table{
  &::v-deep .el-input-number .el-input__inner{
    padding: 0 5px;
    height: 25px;
    width: 100%;
  }
  &::v-deep .el-input-number .el-input{
    width: 75px
  }
  &::v-deep .el-input-number--mini{
    width: 100%;
  }
  &::v-deep .el-input-number__increase{
    display: none;
  }
  &::v-deep .el-input-number__decrease{
    display: none;
  }
  &::v-deep .el-table__footer-wrapper tbody td{
    background: #fdf6ec!important;
  }
}
.fnumber {
  &:hover {
    color: #409eff;
    text-decoration: underline;
    cursor: pointer;
  }
}
.form-layout {
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.tool {
  display: flex;
  flex-direction: row;
  margin-bottom: 10px;
}
.avatar {
  width: 150px;
  height: 150px;
}
.materielImg {
  max-width: 60px;
  max-height: 30px;
}
.summation {
  margin-left: 5px;
}
.tabPosit {
  padding: 5px;
  box-shadow: 0 0 2px #aaa;
  position: absolute;
  top: 3.6vh;
  left: 0;
  background-color: rgba(255, 255, 255, 1);
  z-index: 99999 !important;
}
.tabPosit1 {
  padding: 5px;
  box-shadow: 0 0 2px #aaa;
  position: absolute;
  top: -25.69vh;
  left: 0;
  background-color: rgba(255, 255, 255, 1);
  z-index: 9999;
}
</style>
